package com.ly.algorithm.DataStructures.problem;

/**
 * @Classname Hanoitower
 * @Description TODO
 * @Date 2020/5/3 21:40
 * @Author 冷心影翼
 */
public class Hanoitower {

    public static void main(String[] args) {
        move(32,'A','B','C');
    }

    public static void move(int n,char a,char b,char c) {
        if(n==1) {
            System.out.println(n+ " " +a+"->"+c);
        }else {
            //把上面n-1.txt 个盘 从 a ->b
            move(n-1,a,c,b);
            //把最下面的盘从 a->c
            System.out.println(n+" "+a+"->"+c);
            //把上面n-1.txt 个盘 从 b ->c
            move(n-1,b,a,c);
        }
    }
}
